function Project() {
  this.timerRun = null;
  this.timerStart = null;
  this.planData = {};
  this.runTimes = 0;
  this.next = function (array, num) {
    var that = this;
    array[num]();
    if (num + 1 < array.length) {
      this.timerStart = setTimeout(function () {
        that.next(array, num + 1)
      }, 1000);
    } else {
      clearTimeout(this.timerRun);
      clearTimeout(this.timerStart);
    }
  };
  this.runStep = function (array) {
    var that = this;
    this.timerRun = setTimeout(function () {
      that.next(array, 0)
    }, 2000);
  };
  //提交step
  this.setStep = function (data) {
    $.ajax({
      type: "POST",
      url: "http://192.168.59.99:8080/automatedtest/automated/task/report",
      data: JSON.stringify(data),
      dataType: 'json'
    });
  };
  this.ai = function () {
    return $(document.getElementById('contentIframe').contentDocument);
  };
  this.bi = function () {
    return $(document.getElementById('contentIframe').contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0]);
  };
  this.ci = function () {
    return $(document.getElementById("contentIframe").contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument);
  };
  this.di = function () {
    return $(document.getElementById("contentIframe").contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0]);
  };
  this.ei = function () {
    return $(document.getElementById("contentIframe").contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0]);
  };
  this.fi = function () {
    return $(document.getElementById("contentIframe").contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0]);
  };
  this.gi = function () {
    return $(document.getElementById("contentIframe").contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0].getElementsByTagName("iframe")[0].contentDocument.children[0]);
  };
  this.as = function () {
    return $(document.getElementById('id-main-frame').contentDocument);
  };
  this.bs = function () {
    return $(document.getElementById('id-main-frame').contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0]);
  };
  this.cs = function () {
    return $(document.getElementById('id-main-frame').contentDocument.getElementsByTagName("iframe")[0].contentDocument.children[0]).getElementsByTagName("iframe")[0].contentDocument;
  };
}
var testConfig = new Project();
exports.testFun = testConfig;